﻿using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SBlogCore.Common.App.Options
{
    public class AppsettingOptionsSingle
    {
        private static AppsettingsOptions? _AppOptions;
        //public static AppsettingsOptions? AppOptions _AppOptions;
        public static AppsettingsOptions Data()
        {
            if (_AppOptions == null)
            {
                _AppOptions= AppBase.GetService<IOptions<AppsettingsOptions>>().Value;
            }
            return _AppOptions;
        }

        public static void Change(AppsettingsOptions options)
        {
            _AppOptions = options;
        }
    }
}
